#include <iostream>
#include "Tree.h"
using namespace std;
int main() {
    int size = 10;
    int root_value = 3;
    int node1 = 5;
    int node2 = 8;
    int node3 = 2;
    int node4 = 6;
    int node5 = 9;
    int node6 = 5;
    Tree *t = new Tree(size,root_value);
    t->addNode(0,1,node1);
    t->addNode(0,2,node2);
    t->addNode(1,1,node3);
    t->addNode(1,2,node4);
    t->addNode(2,1,node5);
    t->addNode(2,2,node6);
    int deleted_value = 0;
    cout<<"建好的树:";
    t->treeTravers();
    t->deleteNode(5,&deleted_value);

    cout<<"删除节点:"<<5<<"的值:"<<deleted_value<<endl;
    t->treeTravers();
    cout<<"搜索节点:"<<3<<endl;
    cout<<*t->searchNode(3)<<endl;
    delete t;
    return 0;
}